<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
      .shopcar{
        width: 200px;
        height: 300px;
        border:1px solid green;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
      }
      .biaoti{
        background: lightblue;
        height: 40px;
        line-height: 40px;
        text-align: center;
      }
      .money{
        height: 45px;
        line-height:45px;
        background: #DC4C40;
      }
    </style>
</head>

<body>
    <div id="app">
      <grandfather></grandfather>
    </div>
    <script src="js/vue.js"></script>
    <script>
        Vue.component('grandfather',{
            template:`
                <div style="border:3px solid green;padding:10px;">
                    <h3>我是grandfather</h3>
                    <father></father>
                </div>
            `,
            data:function(){
                return {
                    money:10000
                }
            },
            components:{
                father:{
                    template:`
                    <div style="border:3px solid red;padding:10px;">
                        <h3>我是father</h3>
                        <son></son>
                    </div>
                    `,
                    components:{
                        son:{
                            template:`
                            <div style="border:3px solid purple;padding:10px;">
                                <h3>我是son</h3>  
                            </div>
                            `
                        }
                    }
                }
            }
        })
        var vm = new Vue({
            el: '#app',
            data: {},
            methods: {}
        });
    </script>
</body>

</html>